package org.java.mathgame;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import org.java.mathgame.screens.*;

public class MathGame extends Game {
	public MainMenuScreen mainMenuScreen;
    public GameSettingsScreen gameSettingsScreen;
    public HowToPlayScreen howToPlayScreen;
    public GameScreen gameScreen;
    public HighScoreScreen highScoreScreen;
    private int difficulty;
    // difficulty 1: 1-10, + and -,             number operator number
    // difficulty 2: 1-15, + and - and * and /, number operator number
    // difficulty 3: 1-15, + and - and * and /, number operator number operator number
    // difficulty 4: 1-30, + and - and * and /, number operator number operator number
    private boolean negative;
    // allows or disallows negative numbers (within the difficulty bounds)
    private int gameMode;
    // gamemode 1: time challenge
    // gamemode 2: field clearing
    private boolean gameRunning;
    private HighScoreHandler highScoreHandler;

    public boolean isGameRunning() {
        return gameRunning;
    }

    public void setGameRunning(boolean gameRunning) {
        this.gameRunning = gameRunning;
    }

    public boolean isNegative() {
        return negative;
    }

    public void setNegative(boolean negative) {
        this.negative = negative;
    }

    public int getDifficulty() {
        return difficulty;
    }

    public void setDifficulty(int difficulty) {
        this.difficulty = difficulty;
    }

    public int getGameMode() {
        return gameMode;
    }

    public void setGameMode(int gameMode) {
        this.gameMode = gameMode;
    }

    public HighScoreHandler getHighScoreHandler() {
        return highScoreHandler;
    }

    @Override
	public void create() {
        setDifficulty(1);
        setNegative(false);
        setGameMode(1);
        highScoreHandler = new HighScoreHandler();
        highScoreHandler.checkIfSet();
        mainMenuScreen = new MainMenuScreen(this);
        gameSettingsScreen = new GameSettingsScreen(this);
        howToPlayScreen = new HowToPlayScreen(this);
        highScoreScreen = new HighScoreScreen(this);
        setGameRunning(false);
        setScreen(mainMenuScreen);
	}

	@Override
	public void dispose() {
		mainMenuScreen.dispose();
        gameSettingsScreen.dispose();
        howToPlayScreen.dispose();
        if (gameScreen != null)
            gameScreen.dispose();
        highScoreScreen.dispose();
	}

	@Override
	public void resize(int width, int height) {
	}

	@Override
	public void pause() {
	}

	@Override
	public void resume() {
	}
}
